package prvocisla;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Random;
import java.util.Scanner;

public class Main
{

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		System.out.println("Zadejte cislo.");
		Random rnd = new Random();
		try
		{
			FileWriter fw = new FileWriter(new File("C:/prdel.txt"));
			while (true)
			{
				fw.write(rnd.nextInt());
			}
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
		// check(sc.nextInt());
	}

	private static boolean check(int number)
	{
		int prom = 1;

		for (int i = 2; i <= number; i++)
		{
			if (number % i == 0)
			{
				prom++;
			}
		}

		if (prom == 2)
		{
			System.out.println("je prvocislo");
			return true;
		}
		else
		{
			System.out.println("neni prvocislo");
			return false;
		}

	}
}
